import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'device_verify_method_channel.dart';

abstract class DeviceVerifyPlatform extends PlatformInterface {
  /// Constructs a DeviceVerifyPlatform.
  DeviceVerifyPlatform() : super(token: _token);

  static final Object _token = Object();

  static DeviceVerifyPlatform _instance = MethodChannelDeviceVerify();

  /// The default instance of [DeviceVerifyPlatform] to use.
  ///
  /// Defaults to [MethodChannelDeviceVerify].
  static DeviceVerifyPlatform get instance => _instance;

  //华为设备状态验证token
  static String? deviceToken = "";
  //到期时间，到期后重新获取token
  static int invalidateTime = 0;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [DeviceVerifyPlatform] when
  /// they register themselves.
  static set instance(DeviceVerifyPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getDeviceToken({bool? refresh}) async {
    return null;
  }

  Future<String?> refreshDeviceToken() async {
    return null;
  }
}
